package simpleFactory;

public class Factory {
    public Fruit get(Class<? extends Fruit> fruit){
        try{
            return fruit.newInstance();
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
}
